//
//  HBPageSegmentViewController.h
//  HBLibary
//
//  Created by Rambo on 2018/8/20.
//

#import <UIKit/UIKit.h>
#import "HBPageSegmentView.h"

@interface HBPageSegmentViewController : UIViewController


/**
 快速创建 HBPageSegmentViewController

 @param titleFont 分段标题字体大小
 @param titles 分段标题数组
 @param viewControllers 控制器数组
 @param minMargin 分段标题之间最小间隙
 @param selectIndex 默认选中
 @return HBPageSegmentViewController 实例
 */
- (instancetype)initWithPageSegmentTitleFont:(UIFont*)titleFont titles:(NSArray <NSString *>*)titles viewControllers:(NSArray <UIViewController *> *)viewControllers minMargin:(CGFloat)minMargin defaultSelectIndex:(NSInteger)selectIndex;

/**
 快速创建 HBPageSegmentViewController
 
 @param titleFont 分段标题字体大小
 @param titles 分段标题数组
 @param viewControllers 控制器数组
 @param minMargin 分段标题之间最小间隙
 @param tagWidth 标签宽度
 @param selectIndex 默认选中
 @return HBPageSegmentViewController 实例
 */
- (instancetype)initWithPageSegmentTitleFont:(UIFont*)titleFont titles:(NSArray <NSString *>*)titles viewControllers:(NSArray <UIViewController *> *)viewControllers minMargin:(CGFloat)minMargin tagWidth:(CGFloat)tagWidth defaultSelectIndex:(NSInteger)selectIndex;

@property (nonatomic, strong, readonly) HBPageSegmentView *pageSegmentView;

@property (nonatomic, assign) CGFloat pageSegmentViewHeight;            ///< default height is 2.0f;


/**
 分段改变，子类可重写获取当前index
 
 @param index 当前index
 */
- (void)loadChildControllerViewWithIndex:(NSInteger)index;

- (instancetype)init UNAVAILABLE_ATTRIBUTE;
- (instancetype)initWithFrame:(CGRect)frame UNAVAILABLE_ATTRIBUTE;
+ (instancetype)new UNAVAILABLE_ATTRIBUTE;
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil UNAVAILABLE_ATTRIBUTE;

@end
